import { instance } from '@/utils/request';

const addSearchRecord = async (searchWord: string): Promise<ResponseApiDto> => {
  return instance.post('/SearchRecord/Add', { searchWord });
};

const getAllSearchRecord = async (): Promise<ResponseApiDto> => {
  return instance.get('/SearchRecord/GetAll');
};

const deleteSearchRecord = async (id: number): Promise<ResponseApiDto> => {
  return instance.post('/SearchRecord/Delete', { id });
};

const clearAllSearchRecord = async (): Promise<ResponseApiDto> => {
  return instance.post('/SearchRecord/ClearAll');
};

export default { addSearchRecord, getAllSearchRecord, deleteSearchRecord, clearAllSearchRecord };
